home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGMISC / OVL312.LZH / OVL312.ARC / OVL.DOC < prev    next >
Text File  |  1989-05-10  |  88KB  |  1,952 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                          ======================
  7.                          OVL 3.12 DOCUMENTATION
  8.                          ======================
  9.  
  10.  
  11.  
  12.      LICENSE AND WARRANTY
  13.      --------------------
  14.  
  15.      OVL copyright 1988, 1989 by Michael E. Devore.  All rights
  16.      reserved.
  17.  
  18.      The copyright holder licenses you to use, copy, and distribute
  19.      OVL files for yourself and others subject to the following four
  20.      restrictions:
  21.  
  22.  
  23.      1.  The OVL package must be copied and distributed only in its
  24.          original, unmodified form.  This includes the documentation,
  25.          executable, source, object, and all example files.
  26.  
  27.      2.  No fee or other compensation can be charged for copying or
  28.          distributing the program files.  The only exceptions are
  29.          user groups and incorporated public domain or shareware
  30.          software distributors who may charge a handling fee for its
  31.          distribution NOT TO EXCEED $8.00 PER COPY.  ONLY ONE COPY
  32.          PER COMPUTER DISK IS ALLOWED FOR SUCH DISTRIBUTION.
  33.  
  34.      3.  OVL files may NOT be distributed in combination with any
  35.          other products, software or hardware, without the express
  36.          written permission of Michael E. Devore.
  37.  
  38.      4.  OVL files are for your personal use only and may NOT be used
  39.          for commercial applications.  See the PROVL program
  40.          description in this documentation file if you need to use a
  41.          version of the OVL overlay manager package commercially or
  42.          need a custom version of OVL.
  43.  
  44.  
  45.      There is no warranty of any kind with OVL and the copyright
  46.      holder is not liable for any damages of any kind whatsoever,
  47.      directly or indirectly, that may occur due to use of, or
  48.      inability to use, this software.  By using or distributing OVL
  49.      you agree to these terms.  If you do not agree to these terms,
  50.      you may not use or distribute OVL.
  51.  
  52.      It is the copyright holder's intention to fix any errors in OVL
  53.      and to allow both its noncommercial use and distribution free of
  54.      charge.  The copyright holder, however, is NOT LEGALLY OBLIGATED
  55.      TO DO SO.
  56.  
  57.      This documentation copyright 1988,1989 by Michael E. Devore.
  58.      All rights reserved.
  59.  
  60.  
  61.  
  62.      OVL files                                        page 1 of 2
  63.  
  64.  
  65.  
  66.      OVL FILES
  67.      ---------
  68.  
  69.      Included in the OVL package should be the following files:
  70.  
  71.      OVL.DOC        (OVL documentation file)
  72.      LINKOVL.OBJ    (standard OVL overlay manager)
  73.      OVLSTONE.OBJ   (modifiable OVL overlay manager)
  74.  
  75.      MAPOVL.EXE     (Overlay mapping utility, executable)
  76.      MAPOVL.C       (Turbo C source code for the MAPOVL program)
  77.  
  78.      SCULPT.EXE     (Utility needed to use the OVLSTONE overlay
  79.                      manager, executable)
  80.      SCULPT.C       (Turbo C source code for the SCULPT program)
  81.  
  82.      SPLIT.EXE      (Separate overlay files utility, executable)
  83.      SPLIT.C        (Turbo C source code for the SPLIT program)
  84.  
  85.      PRONK.EXE      (Utility to allow use of Clipper or indirect
  86.                      calls to overlays with OVL)
  87.  
  88.      MASMTEST.ASM   (MASM compatible assembly language example files)
  89.      MASMTEST.OBJ
  90.      OV1.ASM
  91.      OV1.OBJ
  92.      OV2.ASM
  93.      OV2.OBJ
  94.      OV3.ASM
  95.      OV3.OBJ
  96.  
  97.      COW.C          (C example files)
  98.      FARM.C
  99.      HORSE.C
  100.      PIG.C
  101.      PIGLET.C
  102.      SHEEP.C
  103.  
  104.      QBNEST.BAS     (QuickBASIC 4.x and BASCOM 6.x example files)
  105.      BNEST1.BAS
  106.      BNEST2.BAS
  107.      BNEST3.BAS
  108.      BNEST4.BAS
  109.  
  110.      PRTEST.ASM     (MASM compatible assembly language example files
  111.      PRTEST.OBJ      for PRONK demonstration)
  112.      PTEST2.ASM
  113.      PTEST2.OBJ
  114.      PTEST3.ASM
  115.      PTEST3.OBJ
  116.  
  117.  
  118.  
  119.      OVL files                                        page 2 of 2
  120.  
  121.  
  122.  
  123.      MULTEST.ASM    (MASM source code to multiple overlay area
  124.      MULTA.ASM       demonstration program)
  125.      MULTB.ASM
  126.      MULTC.ASM
  127.      MULTD.ASM
  128.  
  129.      MULTEST.EXE    (Demonstration program to show use of multiple
  130.                      overlay areas)
  131.  
  132.      DOGGEREL.TXT   (Alternate loading message example for SCULPT)
  133.  
  134.  
  135.  
  136.      What is OVL?                                     page 1 of 2
  137.  
  138.  
  139.  
  140.      What is OVL?
  141.      ------------
  142.  
  143.      OVL is a powerful overlay manager system for use with Microsoft
  144.      LINK.  So what is an overlay manager and what good is it?  To
  145.      answer that question we first need a little background on what
  146.      overlays are and why they are useful.
  147.  
  148.      Overlays are portions of program code which are loaded from disk
  149.      into memory on an as-needed basis.
  150.  
  151.      Use of overlays allows an extremely large (potentially equal to
  152.      hard disk capacity) program to run in a much smaller amount of
  153.      memory.  Code from the program's .EXE file is brought in from
  154.      disk (overlaid) only when the program needs it.  Since all
  155.      overlays share the same memory space, the memory requirements
  156.      can be much less than the total code size of the program.  Also,
  157.      there is no longer a need for the messy chaining, spawning, or
  158.      exec'ing to another program that some languages require.
  159.  
  160.      There is a tradeoff for these advantages.  The tradeoff is the
  161.      time and code overhead necessary to read overlays in from disk.
  162.      If you make the decision to use overlays with your program, any
  163.      timing critical code should not be divided between overlays.
  164.      For most applications, though, the relatively small amount of
  165.      time it takes to read in an overlay from disk is not important
  166.      if transfers to overlays are not overdone or poorly timed.
  167.      Constant shuttling between overlays is an exercise guaranteed to
  168.      give disappointing results.  A little bit of thought will go a
  169.      long way towards efficient overlay operation.
  170.  
  171.      LINK.EXE, Microsoft's Overlay Linker, included with MS-DOS and
  172.      Microsoft languages, versions 3.x, 5.x, and some 2.x versions,
  173.      allow creation of overlaid programs.  However, LINK only inserts
  174.      software interrupts and some overlay information in the program
  175.      for an overlay manager to use.  LINK doesn't provide the actual
  176.      code that loads the proper overlay from disk and passes control
  177.      to it.  That's a job for an overlay manager, and that's where
  178.      the OVL overlay managers come in.
  179.  
  180.      OVL "manages" overlays.  OVL loads overlays from disk at the
  181.      appropriate time and jumps program execution to the overlay
  182.      code.
  183.  
  184.      Beginning with version 2.2, OVL supports use of multiple overlay
  185.      areas.  To see detailed examples of how to use this option and
  186.      why it is useful, read the section entitled 'USING MULTIPLE
  187.      OVERLAY AREAS (Advanced Operation)'.
  188.  
  189.  
  190.  
  191.      What is OVL?                                     page 2 of 2
  192.  
  193.  
  194.  
  195.      Version 3.0 of OVL introduced a linkable version of OVL called
  196.      LINKOVL.OBJ in addition to the OVL.EXE standalone version.
  197.      Several options were added with version 3.0, including support
  198.      for a overlay log file for debugging purposes, support of
  199.      separate overlay files, and a couple of other options.  Examples
  200.      and a description of these options are covered in the 'COMMAND
  201.      LINE OPTION //x (Advanced Operation)' and 'OTHER COMMAND LINE
  202.      OPTIONS (Advanced Operation) sections.
  203.  
  204.      Version 3.12 of OVL eliminates the obsolete stand-alone version
  205.      of OVL previously available as OVL.EXE.  In OVL.EXE's place
  206.      version 3.12 adds another linkable overlay manager, called
  207.      OVLSTONE.OBJ, that eliminates the use of runtime switches and
  208.      adds some unique enhancements of its own.
  209.  
  210.      If you are or become completely overwhelmed at the size or
  211.      complexity of OVL, be sure to read the 'TOO LARGE!  DOESN'T WORK
  212.      WITH MY DEBUGGER!  TOO COMPLICATED!  PROVL TOO EXPENSIVE!'
  213.      section for an alternative to the OVL overlay managers.
  214.  
  215.  
  216.  
  217.      System requirements                              page 1 of 1
  218.  
  219.  
  220.  
  221.      SYSTEM REQUIREMENTS
  222.      -------------------
  223.  
  224.  
  225.      The OVL package requires an IBM PC or PS/2 microcomputer or
  226.      close compatible with MS-DOS or PC-DOS operating system version
  227.      2.1 or later.  A copy of Microsoft's Overlay Linker version 3.06
  228.      or later, or a version of Microsoft's Object Linker version 3.00
  229.      or later, or a version of Microsoft's Segment-Executable Linker
  230.      version 5.x, is needed to link together the object modules of
  231.      the overlaid program.
  232.  
  233.      In their standard configurations LINKOVL.OBJ and OVLSTONE.OBJ
  234.      require 14K (kilobytes) RAM, in addition to the memory
  235.      requirements of the overlaid program.  Use of multiple overlay
  236.      areas or increasing the relocation table buffer size with OVL's
  237.      /ZB option will increase memory requirements above the standard
  238.      configurations.  The /ZBn option can also be used to reduce the
  239.      default memory requirement by 1K.
  240.  
  241.  
  242.  
  243.      OVL specifications and requirements          page 1 of 2
  244.  
  245.  
  246.  
  247.      OVL SPECIFICATIONS AND REQUIREMENTS
  248.      -----------------------------------
  249.  
  250.      NOTE:  Throughout this documentation, when both the LINKOVL and
  251.      OVLSTONE overlay managers operate identically they will be
  252.      generically referred to as OVL.
  253.  
  254.      *  LINKOVL.OBJ and OVLSTONE.OBJ have been tested with MASM 4.0
  255.         and 5.0; Turbo C 1.0, 1.5 and 2.0; QuickBASIC 4.0 and 4.5;
  256.         Microsoft's BASCOM 6.0; and Clipper (PRONK.EXE, an included
  257.         support utility, must be used with Clipper programs).  Other
  258.         languages that compile to standard Microsoft Overlay LINKable
  259.         object modules MAY also work with OVL.
  260.  
  261.      *  Use of OVL with QuickBASIC 4.x and BASCOM 6.0 requires
  262.         compiling the program with the /O option of BC.EXE.
  263.  
  264.      *  The object files created by versions of QuickBASIC earlier
  265.         than 4.0 abort with an error if a link is attempted with
  266.         overlays.  Therefore, OVL will NOT work with versions of
  267.         QuickBASIC earlier than 4.0.  This is a limitation of the
  268.         earlier versions of QuickBASIC and not an error or
  269.         shortcoming in OVL.
  270.  
  271.      *  The Microsoft LINK object module preprocessor utility
  272.         PRONK.EXE must be used if indirect calls to overlay code are
  273.         required.  Otherwise, calls to a function or procedure FROM
  274.         the root code TO overlay code, or from one overlay to another
  275.         (INTERoverlay calls) MUST be direct, that is, not indirectly
  276.         through a pointer.  This restriction is necessary because
  277.         Microsoft LINK can only set up an interrupt invoking the
  278.         overlay manager for direct calls to program code.  For
  279.         assembly language programs this means that interoverlay calls
  280.         to procedures must be coded as CALL ADDR, not CALL MEM/REG.
  281.         For 'C', interoverlay function calls should be directly
  282.         called, not called through a pointer to a function.  Calls
  283.         within an overlay (INTRAoverlay calls), within the root code,
  284.         or FROM an overlay TO the root can be made indirectly.
  285.         QuickBASIC and BASCOM programs should not be affected by this
  286.         restriction unless non-BASIC modules which use indirect calls
  287.         to overlays are also linked in.  Clipper programmers must use
  288.         PRONK whenever they use the LINKOVL.OBJ overlay manager.
  289.  
  290.      *  Microsoft LINK requires the presence of at least one overlay
  291.         when linking LINKOVL.OBJ or OVLSTONE.OBJ with a program's
  292.         object modules.  An attempt to link either overlay manager
  293.         with a program that doesn't have at least one overlay will
  294.         cause LINK to abort with several "Unresolved external"
  295.         errors.
  296.  
  297.      *  OVL has a limit of twelve overlays in a program.  More than
  298.         twelve overlays will cause OVL to abort with a "Too many
  299.         overlays." error upon startup.  PROVL, the enhanced version
  300.         of OVL, has a limit of 63 overlays -- LINK's current maximum.
  301.  
  302.  
  303.  
  304.      LINKOVL specifications and requirements          page 2 of 2
  305.  
  306.  
  307.  
  308.      *  OVL supports calls from one overlay to another (nesting).
  309.         Overlays can be nested up to four levels.  An attempt to nest
  310.         deeper than four overlays will cause OVL to abort with an
  311.         "Overlays nested deeper than 4 levels." error.  PROVL
  312.         supports a nesting depth of 32 levels.
  313.  
  314.      *  OVL requires use of the Microsoft LINK default overlay
  315.         interrupt 63 (3fh).  Do not use the /OVERLAYINTERRUPT or /O
  316.         option of LINK to change the overlay manager interrupt.
  317.         PROVL supports changing the default overlay manager interrupt
  318.         via the /O option of LINK.
  319.  
  320.      *  OVL will work with the /EXEPACK or /E option of LINK, if the
  321.         program containing overlays is suitable for using the
  322.         /EXEPACK option.  OVL will work with files packed using
  323.         Microsoft's EXEPACK.EXE utility as well.
  324.  
  325.      *  OVL supports two overlay areas: the overlay area allocated by
  326.         Microsoft LINK during the linking process and optionally one
  327.         other overlay area.  If two overlay areas are used, memory
  328.         allocation for the second overlay area is made in normal DOS
  329.         memory.  As a result, the amount of memory available to the
  330.         loaded program decreases.  This decrease, that is, the amount
  331.         used by the second overlay area, is equal to the largest
  332.         overlay file that will load into that overlay area rounded up
  333.         to the next 512-byte block.  PROVL supports up to nine
  334.         overlay areas.
  335.  
  336.      *  After your program has been linked with OVL, do NOT change
  337.         the program's name.  OVL attempts to load overlays from the
  338.         executable file name assigned during the linking process.  If
  339.         the file name has been changed, OVL will abort with a "File
  340.         not found." error when it tries to load an overlay.  To
  341.         change the name of your program, you must relink the program
  342.         using the new name for your executable file in the link
  343.         syntax.
  344.  
  345.      *  LINKOVL uses the PATH environment variable when searching for
  346.         the overlaid program or file.  If LINKOVL attempts to load an
  347.         overlay and the program containing that overlay is neither in
  348.         the current directory nor in a directory in the PATH
  349.         variable, LINKOVL will abort with a "File not found." error.
  350.  
  351.      *  OVLSTONE uses the environment variable specified by the
  352.         SCULPT.EXE utility when searching for the overlaid program or
  353.         file.  If OVLSTONE attempts to load an overlay and the
  354.         program containing that overlay is neither in the current
  355.         directory nor in a directory listed in the SCULPT specified
  356.         environment variable, OVLSTONE will abort with a "File not
  357.         found." error.
  358.  
  359.      *  Both OVL overlay managers use a maximum of 24 bytes of the
  360.         overlaid program's stack during their operation.
  361.  
  362.  
  363.  
  364.      Using LINKOVL.OBJ                                page 1 of 5
  365.  
  366.  
  367.  
  368.      USING LINKOVL.OBJ (Basic Operation)
  369.      -----------------------------------
  370.  
  371.      To demonstrate how to use LINK to set up overlays with
  372.      LINKOVL.OBJ three sample program modules have been included in
  373.      the OVL package.  One set is written using MASM 5.0, another
  374.      using Turbo C, and the third using QuickBASIC 4.x.
  375.  
  376.      As stated in the Microsoft LINK documentation, you MUST
  377.      compile using a large code model for for your programs to work
  378.      correctly with overlays.  For MASM 5.0, this means you must
  379.      compile using .MODEL MEDIUM (far-code, near-data), .MODEL LARGE
  380.      (far-code, far-data), or .MODEL HUGE (far-code, far-data).  If
  381.      you are using an earlier version of MASM you need to make sure
  382.      that PUBLIC procedures in overlays are declared FAR if they
  383.      called by the root code or another overlay.  For Turbo C
  384.      versions 1.x and 2.0, compile your files using the medium,
  385.      large, or huge model.  QuickBASIC and BASCOM users must compile
  386.      their program with BC.EXE using the /O option.  Microsoft's
  387.      runtime program for BASIC, BRUNxx.EXE, will not work with the
  388.      OVL package.  Clipper programmers should carefully read the
  389.      'USING PRONK.EXE' section before using OVL on their programs.
  390.  
  391.      The first example will use the assembly language .ASM files
  392.      MASMTEST, OV1, OV2, and OV3, written using Microsoft's MASM 5.0.
  393.      Although the .MODEL LARGE is used for these example files,
  394.      .MODEL MEDIUM and .MODEL HUGE should work in exactly the same
  395.      fashion for overlaying purposes.  Since MASM requires no
  396.      additional support .OBJ files, you can test the overlay managers
  397.      with the MASM .OBJ files even if you do not have access to an
  398.      assembler such as MASM.
  399.  
  400.      Link together the MASM .OBJ files, enclosing in parentheses the
  401.      modules you want to be overlays.  Make sure that you use at
  402.      create at least one overlay or the overlay managers will not
  403.      work with the file you create.  If you link the object files
  404.      together like this:
  405.  
  406.           link linkovl+masmtest+(ov1+ov2)+(ov3),masmtest;
  407.  
  408.      a standard .EXE file called MASMTEST.EXE will be created.
  409.      MASMTEST.EXE will include the root .EXE file MASMTEST comprised
  410.      of the code of the MASMTEST (and LINKOVL if it is used) object
  411.      module and will also include two overlay files appended to the
  412.      root .EXE file.  One overlay file will contain the code of the
  413.      OV1 and OV2 modules, the other will contain the code of the OV3
  414.      module.
  415.  
  416.      Typing MASMTEST at the command line causes the program to begin
  417.      execution.  As program code is needed from an overlay, that
  418.      overlay is loaded from disk, if necessary, and program execution
  419.      continues.
  420.  
  421.  
  422.  
  423.      Using LINKOVL.OBJ                                page 2 of 5
  424.  
  425.  
  426.  
  427.      The amount of memory required to load the example file
  428.      MASMTEST.EXE, or any file created by LINK using overlays, is
  429.      equal to the size of the root file PLUS the size of the largest
  430.      overlay file PLUS any program overhead and dynamic memory
  431.      allocations made by the program plus OVL's overhead.  This
  432.      brings up an important point.  There is no advantage to only
  433.      using one overlay in a program since memory must be allocated
  434.      for it during program execution anyway.  There is only the
  435.      disadvantage of the overlay overhead.  In other words, while the
  436.      link commands:
  437.  
  438.           link linkovl+masmtest+(ov1)+ov2+ov3,masmtest;
  439.  
  440.           link linkovl+masmtest+ov1+(ov2+ov3),masmtest;
  441.  
  442.           link linkovl+masmtest+(ov1+ov2+ov3),masmtest;
  443.  
  444.      are all valid, there is no useful purpose served by linking
  445.      overlays in this fashion.  Use two or more overlay files in the
  446.      link command.
  447.  
  448.      An example of linking with two overlays is:
  449.  
  450.           link linkovl+masmtest+(ov1)+(ov2)+ov3,masmtest;
  451.  
  452.      Here there will be two overlay files containing the code of,
  453.      respectively, OV1 and OV2 and a root file containing the
  454.      MASMTEST, OV3, and LINKOVL code.
  455.  
  456.      An example of linking with three overlay files is:
  457.  
  458.           link /exepack linkovl+masmtest+(ov1)+(ov2)+(ov3),masmtest;
  459.  
  460.      Three overlay files contain the code of OV1, OV2, and OV3.  The
  461.      root file contains the MASMTEST and LINKOVL code.  The /EXEPACK
  462.      or /E option of Microsoft's Overlay Linker shown in this example
  463.      may successfully be used with those programs suitable for the
  464.      option.
  465.  
  466.      Another example of linking with two overlays is:
  467.  
  468.           link linkovl+masmtest+(ov1+ov3)+(ov2),masmtest;
  469.  
  470.      Two overlay files contain the code of OV1 and OV3, and OV2.  The
  471.      root file contains the MASMTEST and LINKOVL code.
  472.  
  473.      The only overlay combination not allowed by OVL is one where the
  474.      the initial entry code object module(s) -- in this case the
  475.      MASMTEST.OBJ and LINKOVL.OBJ modules -- are linked as an
  476.      overlay.  Such startup code must be loaded in memory during the
  477.      beginning of the program's execution.
  478.  
  479.  
  480.  
  481.      Using LINKOVL.OBJ                                page 3 of 5
  482.  
  483.  
  484.  
  485.      LINKOVL.OBJ users with large root .EXE files, especially Clipper
  486.      programmers, should explore using EXEPACKed files.  Using the
  487.      /EXEPACK option of Microsoft LINK will almost always result in a
  488.      significantly smaller .EXE file with large files than if it is
  489.      not used.  Remember that the EXEPACKed files will not reduce the
  490.      memory requirements of a program.
  491.  
  492.      The second set of files are examples using Turbo C.  To use them
  493.      you need to have a C compiler compatible with the Turbo C source
  494.      files COW.C, FARM.C, HORSE.C, PIG.C, PIGLET.C, and SHEEP.C.  No
  495.      .OBJ files are included due to the many different versions of C
  496.      compilers available; object modules for C are usually compiler
  497.      version specific.  Compile the source files with your own
  498.      compiler.
  499.  
  500.      OVL is put a little more to the test here because the code is
  501.      larger, parameters are passed to the overlays, a value is
  502.      returned from a function, and a command line argument can be
  503.      passed.  Further, in one module, PIG.C, overlays can be nested
  504.      if the 'piglet' function that is called from it is located in a
  505.      different overlay file.
  506.  
  507.      To create FARM.EXE with an overlay file containing the code of
  508.      HORSE and PIGLET and an overlay file containing the code of
  509.      COW, PIG, and SHEEP and a root containing the code of
  510.      FARM and the start up code of C0M, you would link like this,
  511.      assuming that the code has been compiled using the medium model:
  512.  
  513.           link linkovl+c0m+farm+(horse+piglet)+(cow+pig+sheep),farm,
  514.           nul,emu+mathm+cm;
  515.  
  516.      After you link the program try running it by typing FARM and
  517.      FARM MACDONALD to see the command line parameter in use.  All of
  518.      the modules can be put in an overlay except for LINKOVL, C0M,
  519.      and FARM which contain startup code.  Remember, you must use
  520.      Microsoft's LINK when linking this or any other Turbo C program
  521.      for use with OVL.  The copy of TLINK included with Turbo C does
  522.      not support overlays.
  523.  
  524.      The final set of examples are QuickBASIC 4.x files.  Since
  525.      QuickBASIC programs need a QuickBASIC library to link correctly,
  526.      you must own or have access to QuickBASIC 4.x to try these
  527.      example files.  Compile the source files with your BC.EXE
  528.      program.  Almost all Basic module code commands are allowed in
  529.      overlays.  The only known exception to allowed commands in an
  530.      overlaid Basic module is any form of CHAINing, either from or to
  531.      the module.  Other than that, only the standard rules for use of
  532.      separate Basic modules apply.
  533.  
  534.  
  535.  
  536.      Using LINKOVL.OBJ                                page 4 of 5
  537.  
  538.  
  539.  
  540.      These QuickBASIC source files demonstrate how to use COMMON to
  541.      share variables between more than one module if one module is in
  542.      an overlay.  If you have many variables in your COMMONs, you may
  543.      want to consider using $INCLUDE files to declare the variables.
  544.      This will eliminate the need to retype variables in all the
  545.      source modules if you make a change, and reduces the chance of
  546.      erroneous entry.
  547.  
  548.      To really stretch OVL to its limits, link each of the BNEST
  549.      modules in a separate overlay, like this:
  550.  
  551.      link linkovl+qbnest+(bnest1)+(bnest2)+(bnest3)+(bnest4),qbnest;
  552.  
  553.      This forces OVL to nest overlays to its four level maximum.
  554.  
  555.      To use your own QuickBASIC 4.x programs with overlays you should
  556.      compile the files using BC.EXE.  Overlays will not work with the
  557.      runtime file BRUNxx.EXE so the /O option must be used to compile
  558.      QuickBASIC 4.x programs.
  559.  
  560.      Feel free to try any permutation of overlays allowed by these
  561.      examples.  OVL should work with any of them as long as you stay
  562.      within the restrictions already outlined.  It is especially
  563.      important to remember not to put the initial entry code in an
  564.      overlay.  The start up code must be in memory when the program
  565.      is first loaded, i.e. in the root code.
  566.  
  567.      You may have noticed that these example files are all small
  568.      enough to fit into memory without overlays.  You may even be
  569.      asking yourself how you really know that OVL is bringing the
  570.      overlays in as needed instead of sneaking everything in at once?
  571.  
  572.      First, you can try running a file linked with overlays without
  573.      LINKOVL.OBJ.  If you do this your computer will probably lock up
  574.      and need to be turned off or reset before it can be used again.
  575.      This is because your program is using interrupt 63 which OVL
  576.      hasn't initialized to point to code that manages the overlays.
  577.      Your program tries to transfer control to whatever random
  578.      address happens to be at the memory location that corresponds to
  579.      the address at interrupt 63, leading to unpredictable results.
  580.  
  581.      The second test you can do is transfer the overlaid program to a
  582.      floppy and disable any disk caching.  Now run the program.  You
  583.      should see the floppy disk drive light come on during execution
  584.      of the example program as overlays are loaded from disk.  For
  585.      maximum effect you may want to link the example program using as
  586.      many overlays as possible.
  587.  
  588.  
  589.  
  590.      Using LINKOVL.OBJ                                page 5 of 5
  591.  
  592.  
  593.  
  594.      It is important to understand how the use of overlays can affect
  595.      a program's performance.  Time critical code should not be
  596.      divided between two overlays.  Depending upon the speed of the
  597.      disk drive used and the size of the overlay file, the time to
  598.      load each overlay from disk can reach several seconds.
  599.      Extremely time critical code should also not be divided between
  600.      the root code and an overlay.  The execution time overhead of
  601.      the overlay manager code can range from several microseconds up
  602.      to a few milliseconds depending upon the computer used to
  603.      run the overlaid program.
  604.  
  605.      There is NO time penalty involved in calling routines FROM a
  606.      loaded overlay TO the root code or from one code module to
  607.      another WITHIN the same overlay file.  There IS a time penalty
  608.      in calling routines FROM the root code TO an overlay file.  This
  609.      time penalty will range from several microseconds with an
  610.      already loaded overlay file on a fast computer to several
  611.      seconds with an overlay file that needs to be loaded on a
  612.      computer with a slow disk drive.
  613.  
  614.  
  615.  
  616.      Using OVLSTONE.OBJ                               page 1 of 2
  617.  
  618.  
  619.  
  620.      USING OVLSTONE.OBJ and SCULPT.EXE
  621.      ---------------------------------
  622.  
  623.      The OVLSTONE overlay manager works in a very similar fashion to
  624.      the LINKOVL overlay manager (see the 'USING LINKOVL.OBJ'
  625.      section).  However, OVLSTONE allows a programmer more -- and the
  626.      user less -- control over the behavior of the overlay manager
  627.      than LINKOVL does.
  628.  
  629.      To use OVLSTONE, you must first run the SCULPT.EXE utility.  The
  630.      SCULPT utility builds a data file called $$ODATA.OBJ that needs
  631.      to be linked in with OVLSTONE.OBJ when linking the overlaid
  632.      program.
  633.  
  634.      SCULPT will display three fields that you can edit.  The first
  635.      field is the Overlay File Path Environment String, with a
  636.      default value of PATH=.  If you wish the OVLSTONE overlay
  637.      manager to search directories for overlay files or programs in a
  638.      different environment variable than PATH, change this field.
  639.  
  640.      For example, if you wish OVLSTONE to search a environment
  641.      variable called OVERLAY for the overlay directories, enter
  642.      OVERLAY= in this field.  If you do not wish OVLSTONE to search
  643.      any environment variable for overlay directories, fill the field
  644.      with blanks.
  645.  
  646.      The second field is the Sign-on Banner Text.  This is the text
  647.      that the OVLSTONE overlay manager will display while it
  648.      initially loads the overlaid program in addition to OVL'S
  649.      copyright message.  The default text is "Loading....".  If you
  650.      wish no text to be displayed during the overlaid program's
  651.      startup, enter a blank field.
  652.  
  653.      Pressing the F9 key while in the Sign-on Banner Text field will
  654.      toggle the field input to an ASCII file specification to use for
  655.      the sign-on text.  The default file name is SIGN-ON.TXT.  If you
  656.      wish to use a different file name, change the field to the file
  657.      containing the text you wish to be displayed during the overlaid
  658.      program's startup.  SCULPT will use up to the first 4096
  659.      characters in a file as the sign-on text.  This text file is not
  660.      used during the overlaid program's startup, its text is loaded
  661.      by SCULPT and stored in the $$ODATA.OBJ file.  If SCULPT cannot
  662.      find the ASCII file, it will give an error message.
  663.  
  664.      For example, enter DOGGEREL.TXT in the field as an ASCII file
  665.      specification, replacing the default entry of SIGN-ON.TXT.  Link
  666.      PROSTONE.OBJ and $$ODATA.OBJ in with your overlaid program.
  667.      While PROSTONE loads your program you will see OVL's copyright
  668.      message and a short verse about a pet who fully deserves the
  669.      abusive comments.
  670.  
  671.  
  672.  
  673.      Using OVLSTONE.OBJ                               page 2 of 2
  674.  
  675.  
  676.  
  677.      The third field is the Command Line Switch(es) field.  Entries
  678.      in this field correspond to the runtime command line switches or
  679.      options used by the LINKOVL overlay manager.  OVLSTONE does not
  680.      use or recognize runtime command line options.  It uses the
  681.      entry or entries given in the SCULPT Command Line Switch(es)
  682.      field.  The default command line option is /ZDOVERLAY.LOG.
  683.  
  684.      After you have completed entering the information in SCULPT,
  685.      either press F10 to exit and save the changes made, or press the
  686.      Escape key to exit without saving the changes.  If the F10 key
  687.      is pressed, SCULPT will create a file called $$ODATA.OBJ
  688.      containing the data you entered.  To use OVLSTONE, you must link
  689.      in $$ODATA.OBJ.  If you do not link in $$ODATA.OBJ with
  690.      OVLSTONE.OBJ, LINK will generate several unresolved externals
  691.      errors and the OVLSTONE overlay manager will not work properly.
  692.  
  693.      The source to SCULPT.EXE is included in the OVL system as
  694.      SCULPT.C.  SCULPT was written using version 2.0 of Borland's
  695.      Turbo C using object module record information in the MS-DOS
  696.      Encyclopedia.
  697.  
  698.  
  699.  
  700.      OVL multiple overlay areas                       page 1 of 4
  701.  
  702.  
  703.  
  704.      MULTIPLE OVERLAY AREAS (Advanced Operation)
  705.      -------------------------------------------
  706.  
  707.      OVL supports two overlay areas.  This allows you to have two
  708.      overlay files in memory at the same time, and for these overlay
  709.      files to be swapped in and out without the other being affected.
  710.      Why is this important?  Suppose you have two sections of
  711.      initialization code in your program that operate independently
  712.      of each other.  With only one overlay area, in order to reclaim
  713.      the dead space after initialization is completed, you have to
  714.      put both sections in one overlay file.  Even after one section
  715.      is complete the other may still be in use, so each section must
  716.      take up memory until both are finished.  With two overlay areas,
  717.      you could overlay one section as soon as it is complete,
  718.      allowing your program to run under smaller memory requirements.
  719.  
  720.      Such an example only scratches the surface of how two overlay
  721.      areas can be used.  Another example is using separate overlay
  722.      areas for code that runs two different peripherals.  For
  723.      instance, one overlay area could be overlaid with a
  724.      user-selected printer driver, and the other with a particular
  725.      video driver.  Other examples will probably come to mind once
  726.      you start thinking of ways to apply the idea.
  727.  
  728.      Information about which overlay file loads in which overlay area
  729.      is passed via the command line.  There are two switches or
  730.      options allowed, /A (or /a) and /B (or /b).  Do not intermix
  731.      these switches with command line switches or options used by an
  732.      overlaid program when using the LINKOVL overlay manager.
  733.  
  734.      If you are using the LINKOVL overlay manager, both LINKOVL's and
  735.      the program's command line switches come AFTER the program name,
  736.      with LINKOVL's switches coming first.  To differentiate between
  737.      LINKOVL.OBJ and a program's command line switches you should use
  738.      OVL's //x option described in the 'COMMAND LINE OPTION //X'
  739.      section.
  740.  
  741.      The OVLSTONE.OBJ overlay manager does not use or recognize
  742.      runtime command line switches.  All command line switches should
  743.      be typed in the SCULPT.EXE utility.
  744.  
  745.      Each switch should be followed by one or more numbers separated
  746.      by a comma, or range of numbers separated by a dash.  These
  747.      numbers correspond to an overlay file.  Overlay files are
  748.      numbered starting at 1 in the order that they were linked.  The
  749.      /A and /B switches do not represent a particular overlay area,
  750.      but rather differentiate which overlay files are loaded in one
  751.      or the other overlay areas.  The specific overlay area used to
  752.      load an overlay file is transparent to the enduser of the
  753.      program.
  754.  
  755.  
  756.  
  757.      OVL multiple overlay areas                       page 2 of 4
  758.  
  759.  
  760.  
  761.      All files in the switch containing the largest overlay file will
  762.      load in the standard overlay area designated by Microsoft LINK
  763.      during the linking process.  All files listed in the other
  764.      switch load in the second overlay area.  Such switches may be
  765.      either explicitly or implicitly given.  Switches are explicit if
  766.      they are listed in the actual command line, e.g. /A1.  They are
  767.      implicit if an explicit switch does not list all of the overlay
  768.      files; the remaining overlay files are assigned to the unlisted
  769.      (implicit) switch by default.
  770.  
  771.      To demonstrate, if you linked the .OBJ files of the example
  772.      QBNEST files in this manner (OVLSTONE.OBJ users should replace the
  773.      'linkovl' object module with 'ovlstone+$$odata'):
  774.  
  775.           link linkovl+qbnest+(bnest1)+(bnest2)+(bnest4+bnest3),
  776.           qbnest;
  777.  
  778.      you would have three overlay files.  Code for BNEST1 would be in
  779.      overlay file number 1, BNEST2 would be overlay file number 2,
  780.      and code for BNEST3 and BNEST4 would be in overlay file number
  781.      3.  To run this program via OVL with the code from BNEST1,
  782.      BNEST3, and BNEST4 in one overlay area and BNEST2 in the other,
  783.      you would type:
  784.  
  785.           QBNEST /A1,3 /B2
  786.  
  787.      when using LINKOVL or
  788.  
  789.           QBNEST
  790.  
  791.      and specify a command line of /A1,3 /B2 in the SCULPT utility
  792.      when using OVLSTONE.
  793.  
  794.      In this example, overlay files 1 and 3 load in the standard
  795.      overlay area, since overlay file 3 is the largest, and overlay
  796.      file 2 loads in the second overlay area.  Because the overlay
  797.      switches do not correspond to an actual overlay area, the
  798.      following command line would give exactly the same results, if
  799.      you are using LINKOVL.OBJ as the overlay manager:
  800.  
  801.           QBNEST /B1,3 /A2
  802.  
  803.      OVLSTONE users would specify a command line of /B1,3 /A2 in
  804.      sculpt. 
  805.  
  806.      NOTE:  Further examples in this documentation will assume use of
  807.      the LINKOVL.OBJ overlay manager unless otherwise noted.  If you
  808.      are using the OVLSTONE.OBJ overlay manager, substitute the shown
  809.      command line options with the identical SCULPT.EXE Command Line
  810.      Switch entries and in link examples replace LINKOVL with
  811.      OVLSTONE+$$ODATA.
  812.  
  813.  
  814.  
  815.      OVL multiple overlay areas                       page 3 of 4
  816.  
  817.  
  818.  
  819.      Since any overlay files not listed with a switch are assigned to
  820.      the switch not used, this command line would work identically to
  821.      the previous two examples with LINKOVL.OBJ:
  822.  
  823.           QBNEST /A1,3
  824.  
  825.      The /B2 is implied by this command line.  This is why, if you
  826.      use both the /A and /B switch of OVL, you MUST list all overlay
  827.      files in the switches.  Otherwise, when OVL attempts to assign
  828.      the overlay files not listed to an unused overlay area it finds
  829.      both overlay areas used and returns an invalid overlay switch
  830.      value error.  Using the same example:
  831.  
  832.           QBNEST /A1 /B2
  833.  
  834.      results in an invalid overlay switch value error because overlay
  835.      file 3 is not listed and there are no unused overlay areas to
  836.      assign it to.
  837.  
  838.      If all of the overlay files are listed with one switch, the
  839.      advanced option second overlay area is effectively defeated.  In
  840.      other words, if you put all of your overlay files in one overlay
  841.      area there isn't any reason to have the second overlay area.
  842.      While this may sound trite, it is relatively easy to overlook if
  843.      you are depending upon an implicit switch.  For instance, the
  844.      command line:
  845.  
  846.           QBNEST /A1-3
  847.  
  848.      is identical to:
  849.  
  850.           QBNEST
  851.  
  852.      and the second overlay area is not used.  Remember that ranges
  853.      can be represented by a dash, so that /A1-3 is the same as
  854.      /A1,2,3 (and /A1,2-3 or /A1-2,3 as well).
  855.  
  856.      Included with the OVL files is an program called MULTEST.EXE,
  857.      created from the MASM source files MULTEST.ASM, MULTA.ASM,
  858.      MULTB.ASM, MULTC.ASM, and MULTD.ASM.  The MULTEST.EXE program
  859.      provides a graphic demonstration of the power of two overlay
  860.      areas.  MULTEST.EXE has been padded with 160,000 extra bytes to
  861.      increase load time to simulate operation under large file
  862.      conditions.  The size of the resultant file also shows the
  863.      overlay managers' ability to handle overlay files greater than
  864.      64K.  MULTEST.EXE was created with two overlay files using the
  865.      LINK command:
  866.  
  867.           link linkovl+multest+(multa+multb)+(multc+multd),multest;
  868.  
  869.      To best demonstrate the program, transfer a copy of MULTEST.EXE
  870.      to a floppy disk and disable any disk caching.
  871.  
  872.  
  873.  
  874.      OVL multiple overlay areas                       page 4 of 4
  875.  
  876.  
  877.  
  878.      First try basic OVL operation, that is, type MULTEST.  After the
  879.      program loads and displays the prompt, when you press the 'A',
  880.      'B', 'C', or 'D' keys the floppy disk drive light will come on
  881.      as overlays are loaded.  For example, if you first press the 'A'
  882.      key, overlay file 1 will load from disk into memory.  At that
  883.      point neither an 'A' or 'B' keypress will required a disk access
  884.      because the overlay containing the code for process 'A' and 'B'
  885.      is in memory.  If you press 'C' or 'D', the disk drive will be
  886.      accessed again to load in overlay file 2.  Then either 'C' or
  887.      'D' can be pressed without accessing the drive, but an 'A' or
  888.      'B' keypress will reload overlay file 1.
  889.  
  890.      In short, under this arrangement 'C' and 'D' keypresses will
  891.      swap out the overlay file containing the code for processes 'A'
  892.      and 'B', and 'A' and 'B' keypresses will swap out the overlay
  893.      file containing the code for the 'C' and 'D' processes.
  894.  
  895.      Now try typing MULTEST /A1.  This will cause overlay file 1 to
  896.      load in one overlay area when its code is needed and overlay
  897.      file 2 to load in the other.  The disk drive will be accessed
  898.      the first time you press 'A' or 'B' and the first time you press
  899.      'C' or 'D', but once both overlay files are loaded there will be
  900.      no more disk accesses -- no matter which of the four keys you
  901.      press and no matter what the order.
  902.  
  903.      A nice feature of multiple overlay areas and other command line
  904.      options with LINKOVL is that their use is optionally under the
  905.      control of the enduser.  The enduser may dynamically configure
  906.      the program to best fit the memory and speed requirements of a
  907.      specific environment without the need to relink the program, or
  908.      access the object files.  In fact, when using multiple overlay
  909.      areas -- unlike when using one overlay area -- assigning only
  910.      one overlay to a particular overlay area can be advantageous.
  911.      Endusers with large amounts of free memory will probably wish to
  912.      use two overlay areas to keep as much code in memory as
  913.      possible.  Those with less free memory may only be able to use
  914.      one overlay area, paying for the lower memory requirement with
  915.      more frequent disk accesses.  The identical version of a program
  916.      can be used in both cases.  Only the command line arguments
  917.      passed to it at runtime will differ.
  918.  
  919.      OVLSTONE, on the other hand, is better for those who know what
  920.      overlay manager options they want their endusers to have and who
  921.      do not need the flexibility of runtime configuration.  When
  922.      using OVLSTONE, endusers do not have responsibility of supplying
  923.      the proper command line options.  Of course, use of the OVLSTONE
  924.      overlay manager is also required if a loading message or overlay
  925.      directory environment variable different from PATH is needed.
  926.  
  927.  
  928.  
  929.      Command line option //x                          page 1 of 2
  930.  
  931.  
  932.  
  933.      COMMAND LINE OPTION //x (Advanced Operation)
  934.      --------------------------------------------
  935.  
  936.      Programs that use the LINKOVL.OBJ overlay manager and command
  937.      line options that begin with a '/' need a way to distinguish
  938.      between the LINKOVL options and the program options.  This is
  939.      handled by OVL's //x option, where 'x' can be any printable
  940.      character except for the DOS special characters for input and
  941.      output redirection and command piping, i.e. <, >, and |.
  942.  
  943.      The //x option changes the character recognized by OVL as the
  944.      beginning of an option to a different character.  OVL stops
  945.      scanning for options as soon as it encounters a character which
  946.      is not one of its options, passing the remaining command line
  947.      to the overlaid program.
  948.  
  949.      For example, if you had a program named RUNME.EXE that was
  950.      linked with LINKOVL.OBJ and you needed to pass the command line
  951.      options or switches /DEBUG and /X to the program and the command
  952.      line options /A3 and /B1-2 to LINKOVL, you would use this command:
  953.  
  954.           RUNME /A3 /B1-2 //$ /DEBUG /X
  955.  
  956.      The //$ part of the command line directs LINKOVL to look for the
  957.      '$' character for any further command line options.  When
  958.      LINKOVL encounters the next '/' character, it stops looking for
  959.      options and passes the remaining command line, /DEBUG /X, to the
  960.      overlaid program.  The '$' character can be replaced in this
  961.      example by any other character that would serve the purpose of
  962.      forcing LINKOVL to stop scanning when it reaches a program
  963.      option.
  964.  
  965.      Even if you only need to pass command line options beginning
  966.      with a '/' to a program and not LINKOVL, you must still use the
  967.      //x option.  Otherwise, LINKOVL has no way of determining that a
  968.      particular option is not meant for its interpretation.  If you
  969.      have a program that needs the command line option /BELL, but you
  970.      wish to pass no options to LINKOVL, you would use this command:
  971.  
  972.           RUNME //x /BELL
  973.  
  974.      Again, the 'x' character can be replaced by other characters if
  975.      it is necessary or desireable.
  976.  
  977.  
  978.  
  979.      Command line option //x                          page 2 of 2
  980.  
  981.  
  982.  
  983.      The //x option can be used more than once on a particular
  984.      command line, changing the character OVL scans for as a
  985.      beginning to an option each time it is encountered.  For
  986.      example, if you wish to pass the command line options
  987.      /ZDLOGFILE, /A1,2 and /ZS to OVL and the command line options
  988.      /NON, /QS, and /LO to an overlaid program called RUNME, you
  989.      could do it in this fashion:
  990.  
  991.           RUNME //* *ZDLOGFILE **& &A1,2 &&+ +ZS ++/ //# /NON /QS /LO
  992.  
  993.      Of course this is more complicated than necessary.  A more
  994.      mundane approach would be:
  995.  
  996.           RUNME /ZDLOGFILE /A1,2 /ZS //# /NON /QS /LO
  997.  
  998.      the //# switch or option forcing OVL to stop scanning with the
  999.      next '/' character.
  1000.  
  1001.      Although the OVLSTONE.OBJ overlay manager supports the //x
  1002.      option for consistency, there is no need to use it.
  1003.  
  1004.  
  1005.  
  1006.      Other command line options                       page 1 of 2
  1007.  
  1008.  
  1009.  
  1010.      OTHER COMMAND LINE OPTIONS (Advanced Operation)
  1011.      -----------------------------------------------
  1012.  
  1013.      There are three other command line options that the OVL overlay
  1014.      managers can use.  The three options are /ZD<filename>, /ZBn,
  1015.      and /ZS.  Following is a description of each.
  1016.  
  1017.  
  1018.      (1)  The /ZD<filename> option allows a user to specify a debug
  1019.      file that will timestamp and log the loading, access, or swap of
  1020.      each overlay.
  1021.  
  1022.      For example, to log overlays for a program called MYPROG.EXE
  1023.      with two overlay areas into a file called MYPROG.LOG, you could
  1024.      type MYPROG /A1 /B2-4 /ZDMYPROG.LOG at the DOS prompt.  A
  1025.      typical debugging log file for such a situation might look like
  1026.      this:
  1027.  
  1028.           09:15:06  Overlay 01  Loaded
  1029.           09:15:35  Overlay 02  Loaded
  1030.           09:16:07  Overlay 03  Swapped out Overlay 02
  1031.           09:17:12  Overlay 04  Swapped out Overlay 03
  1032.           09:20:14  Overlay 03  Swapped out Overlay 04
  1033.           09:24:00  Overlay 02  Swapped out Overlay 03
  1034.           09:33:53  Overlay 01  Accessed
  1035.           09:39:32  Overlay 02  Accessed
  1036.           09:54:17  Overlay 04  Swapped out Overlay 02
  1037.           09:55:40  Overlay 04  Accessed
  1038.  
  1039.      The timestamp comes first, then the overlay number being
  1040.      manipulated and the number of the overlay being swapped out, if
  1041.      any.   An overlay may either LOAD into an empty overlay area and
  1042.      be accessed, SWAP out another overlay in the overlay area it
  1043.      loads into and be accessed, or simply be ACCESSED, having been
  1044.      loaded during a previous call to the overlay.
  1045.  
  1046.      Devices such as LPT1 or CON are valid filenames for a log file.
  1047.      Preexisting log files will be appended to, rather than
  1048.      overwritten.
  1049.  
  1050.      There is no space between /ZD and the filename when using
  1051.      this option.
  1052.  
  1053.  
  1054.  
  1055.      Other command line options                       page 2 of 2
  1056.  
  1057.  
  1058.  
  1059.      (2)  The /ZBn option shrinks or increases the size of the buffer
  1060.      OVL allocates for reading the relocation table items in an .EXE
  1061.      file header.
  1062.  
  1063.      If the buffer allocation is too small, overlays will take
  1064.      somewhat longer to load because OVL will need to access the disk
  1065.      more than once to read in all of a relocation table.  If the
  1066.      buffer is too large, memory is wasted.  The 'n' following /ZB is
  1067.      the number of kilobytes allocated to the buffer and can be any
  1068.      number from 3 to 8.  The default buffer size is 4K (/ZB4).  This
  1069.      is a good compromise value and probably should not be changed
  1070.      unless you understand what the relocation table in a
  1071.      .EXE file is.  Overlay files with a very large relocation table
  1072.      may load somewhat faster if the buffer size is set to its
  1073.      maximum size of 8K, i.e. /ZB8.  Or, you can reduce the overlay
  1074.      managers' memory requirements by using a table size of 3K
  1075.      (/ZB3).  PROVL expands the allowed 'n' from 1 to 32.
  1076.  
  1077.      If you wish to use the /ZB option, the MAPOVL.EXE utility
  1078.      described in the 'Using MAPOVL.EXE' section may be helpful in
  1079.      selecting an appropriate buffer size for your application.
  1080.  
  1081.      Do NOT insert a space between /ZB and the number when specifying
  1082.      this option.
  1083.  
  1084.  
  1085.      (3)  The /ZS option directs OVL to recognize and load overlays
  1086.      from separate files.
  1087.  
  1088.      You must use the SPLIT.EXE utility to generate individual
  1089.      overlay files from an overlaid program created by Microsoft
  1090.      LINK.  See the 'USING THE SPLIT.EXE UTILITY' section in this
  1091.      manual for more information on separate overlay files and the
  1092.      SPLIT utility.
  1093.  
  1094.      NOTE:  All command line options are case insensitive.
  1095.  
  1096.  
  1097.  
  1098.      Using SPLIT.EXE                                  page 1 of 1
  1099.  
  1100.  
  1101.  
  1102.      USING SPLIT.EXE -- A Utility to Allow Separate Overlay Files
  1103.      ------------------------------------------------------------
  1104.  
  1105.      SPLIT.EXE is a utility that splits off the overlay .EXE files
  1106.      normally appended to the root .EXE file by Microsoft LINK.
  1107.      These overlay files have the same name as the root .EXE file
  1108.      with an extension of '001', '002', and so on up to the number of
  1109.      overlay files in the program.  You must use the /ZS option of
  1110.      OVL if you split separate overlay files off of the main .EXE
  1111.      file.  Otherwise OVL will abort with a "Bad EXE file signature."
  1112.      error when it searches for an overlay at the end of the root
  1113.      .EXE file.
  1114.  
  1115.      To use the SPLIT utility, type SPLIT and press return.  SPLIT
  1116.      prompts you for name of the file to split, then splits up the
  1117.      files, and terminates with a message showing how many overlay
  1118.      files were created.  You may bypass the filename question by
  1119.      typing SPLIT <program name>, e.g. SPLIT MYPROG, if MYPROG.EXE is
  1120.      the overlaid program to split up.  Accidentally running SPLIT on
  1121.      an already split up .EXE file is harmless, SPLIT will find no
  1122.      overlay files to split off and simply terminate.
  1123.  
  1124.      Separate overlay files are most useful when you need to avoid
  1125.      one large program .EXE file, e.g. due to available storage space
  1126.      on floppy disk.  In addition, since OVL automatically searches
  1127.      the entire PATH environment string for an overlay file if it
  1128.      doesn't find the file in the current directory, it is also
  1129.      possible to run overlays off of a different disk drive when the
  1130.      /ZS option is used.
  1131.  
  1132.      Because of the small increase in development time involved in
  1133.      running SPLIT, it is recommended that you not bother with
  1134.      splitting your program into separate overlay files until it is
  1135.      ready for enduser operation.
  1136.  
  1137.      The source to SPLIT.EXE has been included in the OVL package for
  1138.      your study or amusement.  The source file is SPLIT.C.  SPLIT was
  1139.      written using version 2.0 of Borland's Turbo C.
  1140.  
  1141.  
  1142.  
  1143.      Using MAPOVL.EXE                                 page 1 of 2
  1144.  
  1145.  
  1146.  
  1147.      USING MAPOVL.EXE
  1148.      ----------------
  1149.  
  1150.      The utility MAPOVL serves two purposes.  It reports on the
  1151.      actual code size of overlay files without their .EXE header to
  1152.      allow you to see what the memory requirements for particular
  1153.      overlay file and overlay area configurations are.  MAPOVL also
  1154.      displays the number of relocation table items in each overlay
  1155.      file so that you can choose the best /ZBn option for your
  1156.      particular situation.
  1157.  
  1158.      To use the MAPOVL utility, type MAPOVL and press return.
  1159.      MAPOVL prompts you for the name of the overlaid file to
  1160.      report on.  As with SPLIT.EXE, you may bypass the filename
  1161.      question by typing MAPOVL <program name>.  Do not use
  1162.      MAPOVL on a program which has already been had SPLIT.EXE
  1163.      run on it.  MAPOVL searches for overlay files at the end of
  1164.      the root .EXE file.
  1165.  
  1166.      Following is sample output from MAPOVL for a file called
  1167.      TEST.EXE with three overlays:
  1168.  
  1169.  
  1170.      Report on file test.exe
  1171.      =======================
  1172.  
  1173.      DATE:  5/09/1989
  1174.      TIME:  23:22:40
  1175.  
  1176.      Root file:  File size  87552 (15600 hex) bytes
  1177.          Relocation table    19 (13 hex) items,     76 (4c hex) bytes
  1178.          Unaffected by /ZBn option
  1179.  
  1180.      Overlay file  1:  File size  40448 (9e00 hex) bytes
  1181.          Relocation table  5803 (16ab hex) items,  23212 (5aac hex) bytes
  1182.          /ZBn option requires 'n' of 5 for no table reload
  1183.  
  1184.      Overlay file  2:  File size  80384 (13a00 hex) bytes
  1185.          Relocation table     6 (6 hex) items,     24 (18 hex) bytes
  1186.          /ZBn option requires 'n' of 1 for no table reload
  1187.  
  1188.      Overlay file  3:  File size  40448 (9e00 hex) bytes
  1189.          Relocation table 10003 (2713 hex) items,  40012 (9c4c hex) bytes
  1190.          /ZBn option requires 'n' of 40 for no table reload
  1191.  
  1192.      Overlay file 2 always loads into the standard overlay area.
  1193.  
  1194.      Report complete: 3 overlay files
  1195.  
  1196.  
  1197.      After printing the report header and the date and time of the
  1198.      MAPOVL run, MAPOVL reports on the root file.  This provides no
  1199.      information about overlays, but it is handy for comparison of
  1200.      root to overlay file size.
  1201.  
  1202.  
  1203.  
  1204.      Using MAPOVL.EXE                                 page 2 of 2
  1205.  
  1206.  
  1207.  
  1208.      Following the root file report, MAPOVL displays information
  1209.      about each overlay file that it finds.  First it reports on
  1210.      the true file size of the overlay file rounded up to the
  1211.      next 512 byte page.  This is the amount of memory that an
  1212.      overlay file will take up when loaded into an overlay area.
  1213.      Each overlay area will be large enough to accommodate the
  1214.      largest overlay file that loads there.
  1215.  
  1216.      After the file size information, MAPOVL displays the number
  1217.      of relocation table items and the byte size of the
  1218.      relocation table.  The byte size will always be four times
  1219.      the count of items.  MAPOVL uses this information to
  1220.      calculate the minimum /ZBn size that OVL needs to avoid
  1221.      having to reload the relocation table, slowing down the
  1222.      speed at which an overlay loads from disk.  /ZBn sizes are not
  1223.      cumulative, that is, if one file requires an 'n' of 5 for no
  1224.      table reload and another requires an 'n' of 6, /ZB6 will avoid a
  1225.      reload for either file.  If you have the memory to spare, you
  1226.      should use the /ZBn listed for best program performance.  If the
  1227.      recommended /ZBn is higher or lower than the allowed range, use
  1228.      the highest or lowest value allowed.
  1229.  
  1230.      Unless an overlay file is very large or has an extraordinary
  1231.      number of relocation table items, you will generally find that
  1232.      the default /ZB4 is sufficient to avoid a table reload for most
  1233.      situations.  Even if a reload is necessary, the extra delay is
  1234.      usually less than a second and often not noticeable to the
  1235.      program operator.
  1236.  
  1237.      The largest overlay always loads into the standard overlay
  1238.      area allocated by LINK.  MAPOVL shows which overlay loads
  1239.      into the standard overlay area.  This standard overlay area
  1240.      is a part of the root file size.  No additional memory
  1241.      allocations are needed for this overlay area, so the worst case
  1242.      memory allocation for the second overlay area will never be more
  1243.      than the size of the second largest overlay file, and then only
  1244.      if it loads in a different overlay area from the largest overlay
  1245.      file.
  1246.  
  1247.      The source to MAPOVL.EXE has also been included in the OVL
  1248.      package for those interested.  The source file is MAPOVL.C.
  1249.      MAPOVL was written using version 2.0 of Borland's Turbo C.
  1250.  
  1251.  
  1252.  
  1253.      Using PRONK.EXE                                  page 1 of 3
  1254.  
  1255.  
  1256.  
  1257.      USING PRONK.EXE
  1258.      ---------------
  1259.  
  1260.      PRONK is an object module preprocessor for Microsoft's Overlay
  1261.      Linker that allows LINK to properly set up indirect calls to
  1262.      overlay files.  Clipper programmers MUST use PRONK.EXE in
  1263.      conjunction with OVL and any overlaid program.  It is unknown
  1264.      whether PRONK.EXE works other overlay managers, such as the one
  1265.      that comes with Microsoft C.
  1266.  
  1267.      This 2.x version of PRONK greatly enhances the functionality of
  1268.      PRONK 1.x versions by removing the need to save and restore
  1269.      object modules modified by PRONK.
  1270.  
  1271.      PRONK directly reads and writes to object modules, creating
  1272.      an object module called $$MD.OBJ that is linked in with the
  1273.      other object modules in the link command.  Pass the same
  1274.      command line to PRONK that you normally pass to Microsoft
  1275.      LINK.  After PRONK has altered and created the necessary
  1276.      object modules, it automatically invokes LINK with the same
  1277.      command line passed to it except for '+$$md' added to the
  1278.      object file list.  The '+$$md' will be inserted as the
  1279.      second file in the object file list.
  1280.  
  1281.      The example PRTEST.ASM, PTEST2.ASM, and PTEST3.ASM source files
  1282.      show a variety of indirect calls to procedures.  If there were
  1283.      no indirect calls to procedures and you wanted to put PTEST2.OBJ
  1284.      and PTEST3.OBJ in an overlay, you could link in this fashion:
  1285.  
  1286.           link linkovl+prtest+(ptest2)+(ptest3),prtest;
  1287.  
  1288.      However since the object modules in this example contain
  1289.      indirect calls to overlay procedures, linking in this manner
  1290.      with Microsoft's Overlay Linker will not work.  Running PRTEST
  1291.      after linking like this will cause improper behavior when an
  1292.      indirect call to an overlay is made, and possibly lock up the
  1293.      computer.
  1294.  
  1295.      PRONK may be used in such cases to allow proper program
  1296.      operation.  This command line should be used for the previous
  1297.      example:
  1298.  
  1299.           pronk linkovl+prtest+(ptest2)+(ptest3),prtest;
  1300.  
  1301.      While PRONK is running it displays the names of the object
  1302.      modules that it has modified.  Not all object modules may need
  1303.      to be modified by PRONK, often it is necessary to modify only
  1304.      one or two.  After PRONK has finished, it automatically loads
  1305.      and runs LINK, displaying the command line it passes to LINK.
  1306.      The command line in this example is:
  1307.  
  1308.           link linkovl+$$md+prtest+(ptest2)+(ptest3),prtest;
  1309.  
  1310.  
  1311.  
  1312.      Using PRONK.EXE                                  page 2 of 3
  1313.  
  1314.  
  1315.  
  1316.      The PRTEST.EXE program created by PRONK should overlay
  1317.      correctly.  Notice that PRONK has created and added the file
  1318.      $$MD to the object file list passed to LINK.  This object file
  1319.      contains direct calls to publicly defined overlay procedures or
  1320.      functions, allowing LINK to properly set up the overlay manager
  1321.      interrupt.  Any preexisting object file called $$MD.OBJ in your
  1322.      current directory will be overwritten.
  1323.  
  1324.      PRONK also works correctly with response files or options in the
  1325.      LINK command line.  The following command is valid syntax for
  1326.      PRONK assuming that the PRRSP.LNK file exists and is in the
  1327.      current directory:
  1328.  
  1329.           pronk /exepack /nod linkovl+@prrsp.lnk;
  1330.  
  1331.      Note that if you use a response file that contains more than the
  1332.      object file list, this is, a map file, program name, or library
  1333.      list, you MUST place at least one object module outside of the
  1334.      response file.  PRONK always tries to place $$md.obj second in
  1335.      the object file list and such an arrangement will not work
  1336.      correctly if the first entry in the list is a response file
  1337.      which completes the object file list.
  1338.  
  1339.      PRONK correctly handles output file redirection for Microsoft
  1340.      LINK, although PRONK's copyright message, object modules
  1341.      modified message, and the command line passed to MS LINK will
  1342.      appear first in the redirected file.  PRONK will return an
  1343.      errorlevel of 1 to a batch file if it aborts with an error.
  1344.  
  1345.      PRONK reads each object file into memory and then rewrites it if
  1346.      any changes are necessary.  If PRONK is interrupted in the
  1347.      middle of its operation due to power failure or other
  1348.      circumstance, the possibility exists that an object module PRONK
  1349.      was writing to has been corrupted.  PRONK attempts to warn you
  1350.      of circumstances when object modules may have been corrupted,
  1351.      but such warning should not be depended upon as a surety.  If
  1352.      PRONK abnormally aborts, check the object modules modified list
  1353.      to see what files were modified and recompile or restore from
  1354.      backup those that were modified.  IF YOU HAVE ANY IRREPLACEABLE
  1355.      OBJECT MODULES, MAKE SURE THAT YOU HAVE ONE OR MORE BACKUP
  1356.      COPIES OF THOSE MODULES BESIDES THE COPY PRONK IS WORKING WITH.
  1357.  
  1358.      Unlike earlier versions of PRONK you can safely rerun PRONK with
  1359.      the same program object modules that have been modified on a
  1360.      previous PRONK pass.  PRONK will automatically recognize object
  1361.      modules that it has previously modified and make any necessary
  1362.      adjustments without operator intervention.  There is no need to
  1363.      save and restore the original object module as there there was
  1364.      with versions 1.x of PRONK.
  1365.  
  1366.      Because of this enhancement, modified object modules may
  1367.      slightly increase in size.  This size increase will not be
  1368.      reflected in the .EXE file created from the object modules.  It
  1369.      will remain the same size as before.
  1370.  
  1371.  
  1372.  
  1373.      Using PRONK.EXE                                  page 3 of 3
  1374.  
  1375.  
  1376.  
  1377.      You need not rerun PRONK if you change an object module
  1378.      unmodified by PRONK in a previous pass UNLESS the object module
  1379.      has been changed to call a procedure indirectly (always indirect
  1380.      with Clipper) in an overlay object module.  Be sure to link in
  1381.      the last created version of $$MD.OBJ, however.
  1382.  
  1383.      Be aware that PRONK changes code labels in modified object
  1384.      modules.  If PRONK or LINK aborts with an error, you may see
  1385.      error messages containing code labels or procedure names that
  1386.      were not used in the overlaid program's source code.  Avoid
  1387.      using the global labels or names '___AAA' through '___BMI' in
  1388.      your program.  Only the leading three underscores and letters
  1389.      are used by the changed labels.  Three underscore characters
  1390.      before numbers and other legal name characters can be safely
  1391.      used in a program's source code.
  1392.  
  1393.      The code overhead when using PRONK amounts to 6 bytes per public
  1394.      name in the overlay modules, with a maximum capability of
  1395.      handling 1023 public names.  At worst, this will add 6138 bytes
  1396.      to your root code size.
  1397.  
  1398.      The source code to PRONK is available for a fee.  PRONK was
  1399.      written in Turbo C, version 2.0.  To order the source code, send
  1400.      $23.00 to the address in the PROVL section immediately
  1401.      following.  The ordering instructions for the PROVL package and
  1402.      PRONK's source code are the same.  The PROVL commercial overlay
  1403.      manager package does not include the PRONK source code and the
  1404.      $5.00 discount can only be applied once, even if both are
  1405.      ordered.
  1406.  
  1407.  
  1408.  
  1409.      PROVL -- An enhanced version of OVL              page 1 of 2
  1410.  
  1411.  
  1412.  
  1413.      PROVL -- An Enhanced Version of OVL
  1414.      -----------------------------------
  1415.  
  1416.      If you wish to sell a program that uses OVL to operate, or if
  1417.      you just want a more powerful version of OVL, an enhanced
  1418.      version of OVL called PROVL can be purchased for $80.  You may
  1419.      reduce this amount by five dollars (to $75.00) if you send me
  1420.      the name and location of the bulletin board, software
  1421.      distributor, or place where you received your copy of OVL.  If
  1422.      someone else gave you the copy of OVL, ask him or her where they
  1423.      got it from.  The reason for the $5.00 discount is that this
  1424.      information is valuable to me in determining distribution
  1425.      strategies.
  1426.  
  1427.      PROVL adds the following enhancements to OVL:
  1428.  
  1429.           1.  PROVL supports up to nine overlay areas.
  1430.  
  1431.           2.  PROVL allows up to the Microsoft Overlay Linker maximum
  1432.               of 63 overlays.
  1433.  
  1434.           3.  The depth that overlays can nest to is increased to 32
  1435.               levels with PROVL.
  1436.  
  1437.           4.  PROVL works with any overlay interrupt specified by the
  1438.               /O option of LINK.
  1439.  
  1440.           5.  PROVL expands the allowed buffer size of the /ZBn
  1441.               option to 1K through 32K.  For some overlay files this
  1442.               can reduce the overlay manager's overhead by up to 2K
  1443.               with no side effects.  Others may load faster with the
  1444.               higher range /ZBn numbers.
  1445.  
  1446.      PROVL also dispenses with the runtime copyright notice.  This
  1447.      removal of the runtime copyright notice does not suggest, and
  1448.      should not be taken to suggest, that PROVL is not copyrighted.
  1449.      A potentially distracting message is simply not displayed.
  1450.  
  1451.      A bound manual is provided with PROVL for your convenience.
  1452.  
  1453.      No royalties are charged for use of PROVL.  This means that you
  1454.      need only purchase a single version of PROVL for use with your
  1455.      program no matter how many copies of your program you
  1456.      distribute.  Purchase of PROVL entitles the purchaser to
  1457.      telephone support.  I reserve the right to require that all
  1458.      calls be at the purchaser's expense.
  1459.  
  1460.  
  1461.  
  1462.      PROVL -- An enhanced version of OVL              page 2 of 2
  1463.  
  1464.  
  1465.  
  1466.      For those with particular needs, customized or special versions
  1467.      of PROVL are available.  One version allows a user to link in
  1468.      his or her own custom error-handler if a DOS error occurs inside
  1469.      of the overlay manager.  There is no extra charge for a
  1470.      customized change to the standard version of PROVL IF the change
  1471.      is deemed to have potential use for other PROVL users and is not
  1472.      too major.  Very specialized or large changes will cost more
  1473.      than the standard PROVL version.  Please contact me if you
  1474.      require a special version of PROVL.
  1475.  
  1476.      PROVL's source code is NOT available.  If you need or would like
  1477.      the source code to an overlay manager, please read the
  1478.      LOVR/PLOVR section immediately following this section.
  1479.  
  1480.      Purchase of PROVL is MANDATORY if you wish to use a version of
  1481.      OVL for distribution with a commercial or potentially commercial
  1482.      application -- including programs distributed as shareware.
  1483.      PROVL is the only version of the overlay manager permitted for
  1484.      use with such applications and programs.  OVL's copyright
  1485.      license does not legally permit its commercial use.  Please
  1486.      abide by these reasonable terms.  Thank you.
  1487.  
  1488.      To purchase PROVL, send $80.00 in US dollars -- $75.00 if you
  1489.      include a description of where you heard of PROVL -- by check or
  1490.      money order with your shipping address to:
  1491.  
  1492.          Michael E. Devore
  1493.          Devore Software & Consulting
  1494.          403 West Charles
  1495.          Champaign, IL  61820
  1496.  
  1497.      Please state your preference for either 360K 5 1/4 or 720K 3 1/2
  1498.      inch diskettes.  Overseas orders please include an additional $8
  1499.      for shipping.  Federal Express overnight orders please enclose
  1500.      an additional $11 for shipping (remember that you cannot use a
  1501.      P.O. Box with Federal Express).  Other orders will be shipped
  1502.      first class mail with no additional shipping charge.
  1503.  
  1504.      All information contained herein, including the cost of PROVL,
  1505.      is subject to change without notice.
  1506.  
  1507.      PROVL copyright 1988, 1989 by Michael E. Devore
  1508.  
  1509.  
  1510.  
  1511.      Too large!  Too complicated!                     page 1 of 1
  1512.  
  1513.  
  1514.  
  1515.      TOO LARGE!  DOESN'T WORK WITH MY DEBUGGER!
  1516.      TOO COMPLICATED!  PROVL TOO EXPENSIVE!
  1517.      ------------------------------------------
  1518.  
  1519.      There exists a cousin program to OVL, called LOVR, current
  1520.      version 1.14b.  LOVR is strictly a linkable overlay manager with
  1521.      no command line options, e.g. it supports neither multiple
  1522.      overlay areas nor separate overlay files.  As a consequence,
  1523.      LOVR takes up less memory than OVL, approximately 9K.
  1524.  
  1525.      LOVR uses less complicated techniques than the overlay managers
  1526.      in the OVL package.  For example, it simply integrates into the
  1527.      program's code without reloading the overlaid program as the OVL
  1528.      overlay managers do.  More technically speaking, LINKOVL and
  1529.      OVLSTONE use the DOS EXEC function and LOVR does not.  Such an
  1530.      approach may work better with the particular debugger you use on
  1531.      your programs.
  1532.  
  1533.      Since LOVR supports no extra options, it is most useful for
  1534.      those with more modest overlay manager needs who do not require
  1535.      the extra power of OVL.
  1536.  
  1537.      If you wish a copy of LOVR and you have been unsuccessful in
  1538.      obtaining a copy, you may send $6.00 to cover shipping and
  1539.      handling for the latest version to the shipping address in the
  1540.      PROVL section.  No $5.00 discount applies.
  1541.  
  1542.      LOVR also has an enhanced commercial version, called PLOVR.
  1543.      PLOVR adds similar non-command line option enhancements to LOVR
  1544.      that PROVL does to OVL.  A small manual is provided with PLOVR
  1545.      as well.  Additionally, the PLOVR package includes a smaller
  1546.      copy of PLOVR.OBJ called SPLOVR.OBJ, which takes up 5K of
  1547.      program space in the root code, instead of 9K.  The trade-off
  1548.      for the decrease in space is an occasional increase in time to
  1549.      load an overlay from disk in some circumstances, but SPLOVR can
  1550.      be useful for those running close to the memory space limit even
  1551.      with overlays.  PLOVR costs $50, less a $5 discount if you
  1552.      include a description of where you heard of PLOVR (i.e. where
  1553.      you got this OVL package) when you order.  The ordering
  1554.      instructions for the PLOVR package and the PROVL package are the
  1555.      same and can be found in the PROVL section immediately
  1556.      preceding.
  1557.  
  1558.      PLOVR's source code is available for additional cost with a
  1559.      signed license agreement.  The 8088 assembly language source
  1560.      code is fully documented with comments.  Please contact me for
  1561.      details.  PROVL's source code is NOT available.
  1562.  
  1563.  
  1564.  
  1565.      Trouble-shooting                                 page 1 of 3
  1566.  
  1567.  
  1568.  
  1569.      TROUBLE-SHOOTING
  1570.      ----------------
  1571.  
  1572.      Check to make sure that you have compiled your program properly.
  1573.      Turbo C and MASM users must compile their source files using a
  1574.      large or far code memory model.  OVL will not work under a small
  1575.      or near code memory model.
  1576.  
  1577.      Use a recent version of LINK when linking overlays for OVL.  OVL
  1578.      was tested with LINK versions 3.05, 3.06, 3.60, 3.61, 3.64, and
  1579.      3.69 and 5.01.20.  Some 2.x versions of LINK may not work
  1580.      properly.  TLINK, PLINK, or other proprietary linkers will not
  1581.      work with OVL; you must use Microsoft's linker.  In addition, if
  1582.      you experience problems, try linking with a different version of
  1583.      LINK.EXE -- at least one version has errors that causes improper
  1584.      operation when programs are linked with overlays.
  1585.  
  1586.      Check your link syntax, making sure that neither LINKOVL.OBJ or
  1587.      OVLSTONE.OBJ nor the initial entry or main program module is in
  1588.      an overlay, and that you are not exceeding twelve overlay files
  1589.      or nesting overlays deeper than four levels.
  1590.  
  1591.      Link LINKOVL.OBJ or OVLSTONE.OBJ in as the first object module
  1592.      of Microsoft LINK's object file list.  Otherwise, memory
  1593.      requirements for the overlay manager will increase, possibly
  1594.      enough to exceed available memory.
  1595.  
  1596.      If you use the OVLSTONE.OBJ overlay manager, remember to link in
  1597.      the $$ODATA.OBJ file created by SCULPT.  Unlike the overlay
  1598.      managers, the $$ODATA.OBJ file is not position dependent in the
  1599.      LINK object file list.
  1600.  
  1601.      Carefully read the SPECIFICATIONS AND REQUIREMENTS sections to
  1602.      make sure that you are using the OVL programs in accordance with
  1603.      their operating requirements.  One possible mistake for those
  1604.      using OVL with 'C' or assembly language is to indirectly call a
  1605.      function or procedure in one overlay from another or from the
  1606.      root to an overlay without using PRONK on the object modules.
  1607.      Clipper users must always use PRONK, since all of Clipper's
  1608.      calls to overlay procedures are made indirectly.  Microsoft LINK
  1609.      requires direct calls to overlay procedures for it to correctly
  1610.      set up the overlay manager interrupts.
  1611.  
  1612.      Clipper users should not use macros in an overlay that calls
  1613.      procedures in an unloaded overlay since macros bypass the
  1614.      overlay manager.  Macros may call procedures in the root, the
  1615.      same overlay, or another overlay if the other overlay is also
  1616.      loaded in memory (this requires using multiple overlay areas).
  1617.  
  1618.  
  1619.  
  1620.      Trouble-shooting                                 page 2 of 3
  1621.  
  1622.  
  1623.  
  1624.      Use of OVL's advanced options and support utilities brings with
  1625.      it more possibilities of operator error.  If you are using
  1626.      multiple overlay areas, it is important to understand that all
  1627.      overlay files not listed in an OVL command line switch are
  1628.      assigned to a different overlay area from the files listed in
  1629.      the switch.  Check that your switches and switch values match
  1630.      the rules outlined in the 'USING MULTIPLE OVERLAY AREAS' section
  1631.      of this manual.
  1632.  
  1633.      LINKOVL.OBJ users who wish to pass command line options to an
  1634.      overlaid program via the '/' character must use the '//x' option
  1635.      of OVL to avoid confusing LINKOVL into an attempt to take the
  1636.      overlaid program's command line options as its own.  All command
  1637.      line options for an overlaid program must come AFTER LINKOVL's
  1638.      own command line options.
  1639.  
  1640.      Since OVL will search all directories in the PATH or
  1641.      SCULPT-defined environment variable when attempting to find a
  1642.      program containing an overlay file, it is important not to have
  1643.      another file with the same name as the overlay file in a
  1644.      directory earlier in the PATH variable, if the overlaid file is
  1645.      not in the current directory.
  1646.  
  1647.      If you use the utility SPLIT.EXE, remember to use the /ZS option
  1648.      of OVL.  Do not use the /ZS option if the most recent version of
  1649.      the overlaid program has not been run through SPLIT.  Old
  1650.      versions of separate overlay files will cause problems with a
  1651.      non-split program that inadvertently has the /ZS switch in the
  1652.      command line.
  1653.  
  1654.      If you are sure that you are compiling and linking properly and
  1655.      operating OVL within its specifications and requirements, but
  1656.      you still experience problems, make sure that the error is not
  1657.      in your program.  If memory size allows, compile your program
  1658.      without overlays and test it.  If the size of your program is
  1659.      too large for all of it to fit in memory, try to compile only
  1660.      the code that is giving you problems and see if it works
  1661.      correctly without overlays.
  1662.  
  1663.      If your program still fails after you have eliminated all
  1664.      suspects except for OVL, please contact me so I can fix the
  1665.      problem as soon as possible.  However, I will need to know the
  1666.      circumstances.  What error message, if any, does OVL display?
  1667.      What version and options of OVL were used?  What version and
  1668.      options of LINK were used?  What hardware and software
  1669.      configuration was your machine running under when the error
  1670.      occurred?  What language was the program written in?  If I deem
  1671.      it necessary to locate the error, I may request a copy of the
  1672.      program that causes OVL to operate incorrectly.  This copy will
  1673.      be held in the strictest confidence and either returned or
  1674.      destroyed after I am through testing.  You, of course, will have
  1675.      the option of refusing the request, although this will probably
  1676.      mean a delayed, or no, fix for the problem.
  1677.  
  1678.  
  1679.  
  1680.      Trouble-shooting                                 page 3 of 3
  1681.  
  1682.  
  1683.  
  1684.      If an error is in OVL and you are the first person to find the
  1685.      error, I will send you a free corrected version as soon as it is
  1686.      available.  The corrected version will either be sent by e-mail
  1687.      if possible, or regular USPS mail if not.  If you are not the
  1688.      first person to find the error and do not wish to wait for the
  1689.      corrected version to reach general distribution channels, you
  1690.      may send $6.00 to cover shipping and handling for the latest
  1691.      version to the address below.
  1692.  
  1693.      If you subscribe to either the CompuServe Information Service or
  1694.      the GEnie Information Service, you can send me electronic mail
  1695.      at the appropriate e-mail address below.  Barring vacation or
  1696.      unusual circumstances, I check in to the CIS and GEnie services
  1697.      at least once a week -- usually more frequently.  Your e-mail
  1698.      will be acknowledged as soon as I receive it.
  1699.  
  1700.      If you do not subscribe to either CompuServe or GEnie you should
  1701.      contact me through USPS mail at the address given at the end of
  1702.      this section.
  1703.  
  1704.      The realities of life and need for income being what they are,
  1705.      my billable work and support of my commercial software has
  1706.      priority over fixes to and questions concerning OVL or LOVR.  If
  1707.      I have a full work schedule, a fix or question may take more
  1708.      time to respond to than either you or I would prefer.  This is
  1709.      unfortunate, but unavoidable.
  1710.  
  1711.      MAILING ADDRESS:
  1712.           Michael E. Devore
  1713.           Devore Software & Consulting
  1714.           403 West Charles
  1715.           Champaign, IL  61820
  1716.  
  1717.      E-MAIL ADDRESSES:
  1718.           CompuServe      71540,62
  1719.           GEnie           MDEVORE
  1720.           (BIX sign-on has been cancelled, do not use)
  1721.  
  1722.  
  1723.  
  1724.      Overlay Technical Documentation                  page 1 of 2
  1725.  
  1726.  
  1727.  
  1728.      OVERLAY TECHNICAL DOCUMENTATION
  1729.      -------------------------------
  1730.  
  1731.      It is not necessary to read or understand this part of the OVL
  1732.      documentation to use OVL.  This technical documentation is
  1733.      included for those who wish to know more information about how
  1734.      overlay calls are set up by Microsoft LINK.
  1735.  
  1736.      When you link a program with overlays, LINK sets up direct calls
  1737.      to code in the overlays in a special way.  All of these calls
  1738.      are replaced with an interrupt.  By LINK default the interrupt
  1739.      is 63 decimal or 3f hexadecimal, although the interrupt can be
  1740.      changed using the /O or /OVERLAYINTERRUPT LINK option.  This
  1741.      option is not supported by OVL, although PROVL does support it.
  1742.  
  1743.      Immediately following the interrupt inserted by LINK are three
  1744.      bytes of data.  The first byte is used by the overlay manager as
  1745.      an offset into an table found in the root .EXE code (usually
  1746.      located at the end of the root) that determines which overlay
  1747.      should be loaded into memory.  The second two bytes give the
  1748.      value that the Instruction Pointer (IP) should have when a jump
  1749.      to the overlay code is executed.  When the overlay manager is
  1750.      called by the interrupt, it needs to adjust the return address
  1751.      to point past these three bytes.
  1752.  
  1753.      The remaining information that the overlay manager needs can
  1754.      usually be found at the end of the root .EXE file.  Note that an
  1755.      overlaid .EXE program has overlay .EXE files appended to the
  1756.      root .EXE file.  Also, at least one non-default option of MS
  1757.      LINK, the /EXEPACK option places additional information at the
  1758.      end of the root .EXE file.
  1759.  
  1760.      Each overlay file has its own header that follows the standard
  1761.      format of normal .EXE file headers, including items in a
  1762.      relocation table that need to have fixups performed on them.
  1763.  
  1764.      The overlay information in the root file corresponds to data in
  1765.      the OVERLAY_DATA segment created by MS LINK.  All of the data
  1766.      has a MS LINK internal variable name, although these names are
  1767.      documented nowhere by Microsoft to the best of my knowledge.
  1768.      The names are prefixed with a '$$' and can be seen if you look
  1769.      at a binary dump of LINK.EXE.  The information that the root
  1770.      .EXE has is as follows:
  1771.  
  1772.  
  1773.           1 word containing the count of all segments in overlay
  1774.           files plus one.
  1775.  
  1776.           1 word containing the total .EXE files in the main .EXE
  1777.           file.  This will equal the number of overlay files plus one
  1778.           for the root.
  1779.  
  1780.           1 zero word.  This word is fixed up to the program load
  1781.           segment when the program is loaded into memory.
  1782.  
  1783.  
  1784.  
  1785.      Overlay Technical Documentation                  page 2 of 2
  1786.  
  1787.  
  1788.  
  1789.           A table with entries for each overlay that, when added to
  1790.           the root program load segment, provide the value the Code
  1791.           Segment (CS) should have when a jump to the overlay code is
  1792.           executed.  MS LINK fixes up the values in this table as
  1793.           well.  If using LINK's internal '$$' variables during
  1794.           runtime, the need to add in the root program load segment
  1795.           value is negated.
  1796.  
  1797.           1 zero word.
  1798.  
  1799.           A table that uses the first byte following the interrupt in
  1800.           the calling code for an offset.  The entries in the table
  1801.           determine which overlay has the necessary code and should
  1802.           be loaded in memory, if it isn't loaded already.
  1803.  
  1804.           Variable number of zero bytes.
  1805.  
  1806.           The name of the main .EXE file that normally has all of the
  1807.           overlay files appended to it.  This will not be true if you
  1808.           have used the SPLIT.EXE program to create separate overlay
  1809.           files.
  1810.  
  1811.           Variable number of zero bytes.  These bytes have a
  1812.           corresponding MS LINK internal variable name, but their
  1813.           use, if any, is unknown to me.
  1814.  
  1815.           The number of the interrupt LINK inserts in the program
  1816.           code that is vectored to the overlay manager code.
  1817.  
  1818.  
  1819.      This information has remained stable for Microsoft LINK
  1820.      versions 3.05 through 3.69.  It may change for future versions
  1821.      of Microsoft LINK.
  1822.  
  1823.      The information presented here is solely for your interest and
  1824.      entertainment.  Michael E. Devore makes no claims or guarantees
  1825.      of the accuracy of this information.  Use of this information is
  1826.      strictly at your own risk.
  1827.  
  1828.  
  1829.  
  1830.      Comments and Miscellany                          page 1 of 2
  1831.  
  1832.  
  1833.  
  1834.      COMMENTS and MISCELLANY
  1835.      -----------------------
  1836.  
  1837.      OVL is shareware.  No, that does not mean I am going to request
  1838.      or require you to send money if you use it longer than a
  1839.      reasonable trying out period.  What it means is that OVL is a
  1840.      zero dollar registration, copyrighted program with some use
  1841.      restrictions, most notably that it is only for noncommercial
  1842.      use.  If you use, or plan to use, OVL in one or more programs
  1843.      over a period of a month or more, then you should register it.
  1844.      To register, all I ask is that you send me your home address and
  1845.      the name and location of the bulletin board, software
  1846.      distributor, or place where you received your copy of OVL.  If
  1847.      someone else gave you the copy of OVL, ask him or her where they
  1848.      got it from.  You may send this information to me via US mail or
  1849.      electronic mail.
  1850.  
  1851.      I will not put your address on some mailing list or deluge you
  1852.      with advertisements.  The reason I ask for this information is
  1853.      that it is very valuable to me.  Knowing where OVL is being
  1854.      distributed, what distribution sites are most successful, and
  1855.      the address spread of those who frequent the distribution sites
  1856.      is extremely helpful.
  1857.  
  1858.      If you feel that you must reward me monetarily or you do not
  1859.      wish to divulge where you got your copy of OVL for whatever
  1860.      reason, then send me a letter with your return address and a
  1861.      quarter (25 cents) inside as an alternate method to register
  1862.      OVL.  This will help cover the postage cost of those who send
  1863.      letters asking for help without sending a self-addressed stamped
  1864.      envelope and the overhead cost of receiving and answering e-mail
  1865.      queries.  Individually these costs are small, but they can (and
  1866.      do) mount rapidly.
  1867.  
  1868.      OVL should be powerful enough for most casual or part-time
  1869.      programmers needing a solution to the problem of a program that
  1870.      has gotten too large to fit in available memory.  OVL is also
  1871.      for professional programmers who have the same problem with a
  1872.      personal application.  Those who need a more powerful solution
  1873.      or who wish to use this type of overlay manager for a commercial
  1874.      application should be able to afford the enhanced PROVL version.
  1875.      Such an approach is in keeping with my philosophy of allowing
  1876.      those chronically short on cash to still have the benefits of
  1877.      some programming tools.  I have great sympathy for persons with
  1878.      little money, having been in that position myself on more than
  1879.      one occasion.  This philosophy should not be interpreted as
  1880.      support for piracy, nonpayment of shareware fees, or other
  1881.      unethical acts.  Nor should it be interpreted as precluding my
  1882.      releasing other shareware with a fee-based registration in the
  1883.      future.  I just think it is pleasant that not all programs have
  1884.      a price tag attached.  OVL is one of many programs in this
  1885.      category.  Look around, despite what cynics (and purveyors of
  1886.      high-priced software) may say, programs do not have to be
  1887.      expensive to be good.
  1888.  
  1889.  
  1890.  
  1891.      Comments and Miscellany                          page 2 of 2
  1892.  
  1893.  
  1894.  
  1895.      OVL is written entirely in 8088, also known as 8086, assembly
  1896.      language.  I feel that this is necessary to achieve acceptable
  1897.      speed and size overhead, especially with older computers, while
  1898.      maintaining maximum compatibility.  While some optimizations to
  1899.      OVL's code can undoubtably be made, I am skeptical that a
  1900.      significant decrease in code size is possible while retaining
  1901.      all of its functionality.
  1902.  
  1903.      If you have an idea for an improvement to OVL, a comment or
  1904.      question about OVL, or even a complaint about OVL, please send
  1905.      it to either my USPS mailing address or one of the e-mail
  1906.      addresses below.  I am receptive to new ideas and constructive
  1907.      criticism.  Your comments DO make a difference.  Several
  1908.      enhancements to OVL have come about due to user requests so
  1909.      don't be shy about dropping me a postcard or sending
  1910.      e-mail.  I am also interested in what applications or other
  1911.      languages you use OVL with.
  1912.  
  1913.      OVL began as a grass-roots solution to the problem of a low-cost
  1914.      overlay manager.  I hope to maintain that attitude and never
  1915.      acquire the arrogant traits exhibited by some software
  1916.      developers and corporations.  With your help, I plan to keep OVL
  1917.      a viable, useful, low- or no-cost alternative to overpriced
  1918.      software.
  1919.  
  1920.           Michael E. Devore       
  1921.           Devore Software & Consulting
  1922.           403 West Charles 
  1923.           Champaign, IL  61820
  1924.  
  1925.           CompuServe   71540,62
  1926.           GEnie        MDEVORE
  1927.           (BIX sign-on has been cancelled, do not use)
  1928.  
  1929.  
  1930.                    _______
  1931.               ____|__     |               (tm)
  1932.            --|       |    |-------------------
  1933.              |   ____|__  |  Association of
  1934.              |  |       |_|  Shareware
  1935.              |__|   o   |    Professionals
  1936.            -----|   |   |---------------------
  1937.                 |___|___|    MEMBER
  1938.  
  1939.  
  1940.      This program is produced by a member of the Association of
  1941.      Shareware Professionals (ASP).  ASP wants to make sure that the
  1942.      shareware principle works for you. If you are unable to resolve
  1943.      a shareware-related problem with an ASP member by contacting the
  1944.      member directly, ASP may be able to help. The ASP Ombudsman can
  1945.      help you resolve a dispute or problem with an ASP member, but
  1946.      does not provide technical support for members' products. Please
  1947.      write to the ASP Ombudsman at P.O. Box 5786, Bellevue, WA 98006
  1948.      or send a Compuserve message via easyplex to ASP Ombudsman
  1949.      70007,3536.
  1950.  
  1951.  
  1952.